@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
              <span class="page-title-icon bg-gradient-primary text-white mr-2">
                <i class="mdi mdi-home"></i>
              </span>
                    控制台
                </h3>
                {{--<nav aria-label="breadcrumb">--}}
                {{--<ul class="breadcrumb">--}}
                {{--<li class="breadcrumb-item active" aria-current="page">--}}
                {{--<span></span>Overview--}}
                {{--<i class="mdi mdi-alert-circle-outline icon-sm text-primary align-middle"></i>--}}
                {{--</li>--}}
                {{--</ul>--}}
                {{--</nav>--}}
            </div>
            <div class="row">
                <div class="col-md-4 stretch-card grid-margin">
                    <div class="card bg-gradient-danger card-img-holder text-white">
                        <div class="card-body">
                            <img src="/assets/images/dashboard/circle.svg" class="card-img-absolute" alt="circle-image"/>
                            <h4 class="font-weight-normal mb-3">今日黑名单命中次数
                                <i class="mdi mdi-chart-line mdi-24px float-right"></i>
                            </h4>
                            <h2 class="mb-5">{{$todayCount}}</h2>
                            <h6 class="card-text"></h6>
                        </div>
                    </div>
                </div>
                <div class="col-md-4 stretch-card grid-margin">
                    <div class="card bg-gradient-info card-img-holder text-white">
                        <div class="card-body">
                            <img src="/assets/images/dashboard/circle.svg" class="card-img-absolute" alt="circle-image"/>
                            <h4 class="font-weight-normal mb-3">本周黑名单命中次数
                                <i class="mdi mdi-bookmark-outline mdi-24px float-right"></i>
                            </h4>
                            <h2 class="mb-5">{{$weekCount}}</h2>
                            <h6 class="card-text"></h6>
                        </div>
                    </div>
                </div>
                <div class="col-md-4 stretch-card grid-margin">
                    <div class="card bg-gradient-success card-img-holder text-white">
                        <div class="card-body">
                            <img src="/assets/images/dashboard/circle.svg" class="card-img-absolute" alt="circle-image"/>
                            <h4 class="font-weight-normal mb-3">本月黑名单命中次数
                                <i class="mdi mdi-diamond mdi-24px float-right"></i>
                            </h4>
                            <h2 class="mb-5">{{$monthCount}}</h2>
                            <h6 class="card-text"></h6>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <table class="table" style="width:80%; margin-left: 20px;">
                <thead>
                <tr>
                    <th>APP名</th>
                    <th>渠道名</th>
                    <th>渠道链接</th>
                    <th>类型</th>
                    <th>来源</th>
                    <th>次数</th>
                </tr>
                </thead>
                <tbody>
                @foreach($result as $v)
                    <tr>
                        <td>{{ $v['app_name'] }}</td>
                        <td>
                            {{ $v['channel_name'] }}
                        </td>
                        <td>
                            {{ $v['channel_url'] }}
                        </td>
                        <td>
                            @if($v["type"] == 1)
                                <label class="badge badge-primary">Web</label>
                            @elseif($v["type"] == 2)
                                <label class="badge badge-dark">App</label>
                            @else
                            @endif
                        </td>
                        <td>{{ $v['url'] }}</td>
                        <td>{{ $v['total'] }}</td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
        <!-- partial:partials/_footer.html -->
{{--        <footer class="footer">--}}
{{--            <div class="d-sm-flex justify-content-center justify-content-sm-between">--}}
{{--                <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">Copyright © 2018-201 <a href="#" target="_blank">Yamecent</a>. All rights reserved. </span>--}}
{{--            </div>--}}
{{--        </footer>--}}
        <!-- partial -->
    </div>
@endsection
